package com.example.agent_intelligent_companion;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;

public class LoginActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    // This is called when the user clicks the login button on the main screen.
    // Will check for the correct login name and password then take to the main activity.
    public void RunLogin(View view)
    {
    	if(CheckCredentials())
    	{
    		Intent intent = new Intent(this, MainActivity.class);
    		startActivity(intent);
    	}
    	else
    	{
    		// TODO: put an error message saying login failed.
    	}
    }
    
    public boolean CheckCredentials()
    {
    	boolean success = true;
    	
    	// TODO: Check the login status, for now just return true until DB is set up.
    	
    	return success;
    }
    
}
